feat(scripts): kernel-level axiom sweep with committed regression baseline - #300
Conversation
…eline Add `lake exe axiomsweep`: walks the compiled environment and computes, for every CompPoly.* declaration, its transitive axiom dependencies — the #print axioms information, library-wide, in one pass. Reads elaborated .olean data, so private and macro-generated declarations are included and no source heuristics are involved. Baseline at this commit: 7589 declarations across 275 modules, 0 sorryAx-tainted, 0 non-standard-axiom-tainted — the library is fully kernel-clean, and --check now keeps it that way (fails iff a declaration is tainted that scripts/axiom_baseline.json does not list; the 6 'sorry' tokens greps report on main are all inside comments). Wire-up: report-only CI step in lean_action_ci.yml after the warm rebuild; docs/wiki/quickstart.md documents the workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, docs Collector: two-phase DFS + fixpoint repair. The one-pass DFS finalized self-referencing constants (every inductive/ctor pair) prematurely and memoized the wrong result for all later roots — confirmed by review to produce rows diverging from #print axioms on sibling repos. The repair pass re-derives every set in finalization order until stable: the least fixpoint = true kernel closure, strictly more accurate than #print axioms inside mutual families. Also: axiom *types* are traversed (CollectAxioms parity), duplicate constNames rows deduped (7589→7573), native trust-axiom names normalized to their owner (ax_N_M counters are Elab.async/toolchain-volatile), --check/--update-baseline mutually exclusive, unknown --root fails gracefully, nonstandard shrinkage detected, and bare Lean.ofReduceBool/Lean.trustCompiler are never baselinable (floor). Docs: known blind spots documented (structure-field defaults and examples never enter any environment walk; unimported files — paired with check_imports); scope stated (tests/ and bench/ outside the sweep); corrected sorry-token count (5, all comments); inventory rows added to scripts/README.md, docs/wiki/generated-files.md, AGENTS.md fast-start, quickstart CI mapping + lower-level commands. CI: infrastructure failures (exit != 1) now fail the step; only taint findings are report-only during the soak. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…teral for 4.30/4.31 portability Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🤖 PR Summary
feat(scripts): kernel-level axiom sweep with committed regression baseline Statistics
Lean Declarations ✏️ Added: 18 declaration(s)
❌ Added: 4 `sorry`(s)
📋 **Additional Analysis**No findings. 📄 **Per-File Summaries**
Last updated: 2026-09-01 19:09 UTC. |
Build Timing Report
Incremental Rebuild Signal
Slowest Current Build Files (warm library build)Showing 5 slowest of 5 repo targets parsed from the current warm library build log.
|
|
so, I added a |
|
(removed the |
|
Fixed in 8ad1aa2: the axiom sweep is now an enforcing CI gate, so exit 1 fails the build. I also closed the native-trust baseline hole: generated |
dhsorens
left a comment
There was a problem hiding this comment.
Reviewed on current main / Lean 4.33.1. The enforcing CI behavior, native-trust floor, clean build/test results, and documentation are all consistent. Ready to merge once required checks pass.
What
Adds
lake exe axiomsweep: kernel-level axiom /sorryaccounting for the wholelibrary, backed by a committed regression baseline and an enforcing CI gate.
The tool loads the built
.oleanenvironment and computes the transitive axiomdependencies of declarations under the swept root modules. This checks elaborated
kernel input rather than source text, so comments containing
sorrydo not createfalse positives.
Why
CompPoly is a correctness-critical dependency of downstream provers. This PR makes
the library's current kernel-clean status mechanically checkable and prevents new
sorryAxor non-standard-axiom dependencies from silently entering CI.How
scripts/AxiomSweep.lean: memoised traversal plus fixpoint repair for cycles;runtime-imports the built CompPoly environment and produces deterministic results.
scripts/axiom_baseline.json: records existing baselineable taint. New taintfails
--check; removed taint stays green and prompts the baseline to shrink.Lean.ofReduceBool/Lean.trustCompilerand generated…._native.<tactic>.ax_*dependencies always fail and cannot be baselined.lake exe axiomsweep --checkas an enforcing gate after the build.blind spots.
Modes
Current result
sorryAx-tainted declarations.Adversarial verification
sorryis detected and makes--checkexit 1.--checkexit 1.--update-baselinerefuses native trust, exits 1, and leaves the baseline unchanged.lake build,lake test, the axiom sweep, import checking,style lint, and documentation integrity checks on the current
main/ Lean 4.33.1.Known limits remain documented: examples and structure-field defaults do not produce
ordinary reportable declarations, and unimported modules are invisible to an
environment walk; the repository's import-completeness check covers the latter.
🤖 Generated with Claude Code